package com.liang.map;

import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;

public class ForHashMap2 {
    public static void main(String[] args) {
        LinkedHashMap<String, String> map = new LinkedHashMap<>();

        map.put("一号丈夫", "一号妻子");
        map.put("二号丈夫", "二号妻子");
        map.put("三号丈夫", "三号妻子");
        map.put("四号丈夫", "四号妻子");
        map.put("五号丈夫", "五号妻子");
        map.put("六号丈夫", "六号妻子");
        map.put("七号丈夫", "七号妻子");

        Set<Map.Entry<String, String>> entries = map.entrySet();

        for (Map.Entry<String, String> entry : entries) {
            String key = entry.getKey();
            String value = entry.getValue();
            System.out.println(key+"---"+value);
        }
    }
}
